import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-11-12
 * 22:24
 */
class Test{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int i=sc.nextInt();
        int n=sc.nextInt();
        int count=0;
        for(int j=i;j<=n;j++){
            while(j!=0){
                if((j%10)==9){
                    count++;
                }
                j/=10;
            }
        }
        System.out.println(count);
    }
}
